function [vgcp_x, vgcp_y, vgcp_z, vgcp_col, vgcp_row, img_size] = loadResampDat(dat_path)
%读取拟合RPC模型所需的虚拟控制点数据
%   物方坐标: vgcp_x(经度), vgcp_y(纬度), vgcp_z(高度)
%   像方坐标: vgcp_col(列), vgcp_row(行)
%   图像高宽: img_size

    fid = fopen(dat_path, "rb");
    if fid == -1
        error("cannot open: %s\n", dat_path);
    end

    width = fread(fid, 1, "int");
    height = fread(fid, 1, "int");
    img_size = [height, width];
    N = fread(fid, 1, "int");
    vgcp_x = fread(fid, N, "double");
    vgcp_y = fread(fid, N, "double");
    vgcp_z = fread(fid, N, "double");
    vgcp_col = fread(fid, N, "double");
    vgcp_row = fread(fid, N, "double");
    
    fclose(fid);
end
